<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$admin_title}</title>
<include file="./core/Modules/Center/Tpl/Public/js_css_header.html" />
<script type="text/javascript">
	function showChangeOrderNum(idVal){
        $(".span_block").show();
        $(".action_block").hide();
        $(".action_block"+idVal).show();
        $(".span_block"+idVal).hide();
    }
    //点击[保存]按钮
    function saveOrderNum(idVal){
        var order_num_val = $("#order_"+idVal).val();
        $.post("__APP__/center/ReserveModuleField/change_order_num/", { id: idVal,order_num:order_num_val, time: new Date().getTime() },function(result){
            if(result.status == 0){
                alert(result.msg);
            }else{
                $(".span_"+idVal).html(order_num_val);
                $(".span_block"+idVal).show();
                $(".action_block"+idVal).hide();
            }
        },"JSON");
    }
</script>
</head>

<body>
	<include file="./core/Modules/Center/Tpl/Public/header.html" />
	<table width="100%" height="100%" class="manage_block">
	  <tbody>
	    <tr>
	      <td class="manage_left" valign="top">
	      	<include file="./core/Modules/Center/Tpl/Public/system_manage_left.html" />
	      </td>
	      <td valign="top">
	        <div class="cont_wrap">
				<div class="position">当前位置:&nbsp;<a href="__APP__/center/frame/index/">首页</a>&nbsp;&gt;&nbsp;<a href="__APP__/admin/ReserveModule/" target="_self">表单模块管理</a>&nbsp;&gt;&nbsp;[<strong style="color:green;">{$reserve_module.module_name}</strong>]&nbsp;模块字段管理</div>
				<div class="proc_line">
				    <div class="add"><a href="__APP__/center/ReserveModuleField/todo/?reserve_module_id={$reserve_module_id}">新增</a></div>
				    <div class="clear"></div>
				</div>
				<table id="list_table" width="100%" border="0" cellpadding="0" cellspacing="1" class="list_table_line">
		          <tr>
		            <td height="22" class="table_head"><div align="center"><span>字段名称</span></div></td>
		            <td height="22" class="table_head"><div align="center"><span>描述</span></div></td>
		            <td height="22" class="table_head"><div align="center"><span>字段类型</span></div></td>
		            <td height="22" class="table_head"><div align="center"><span>是否系统字段</span></div></td>
					<td height="22" class="table_head"><div align="center"><span>排序值&nbsp;(越大越靠前)</span></div></td>
		            <td height="22" class="table_head"><div align="center">基本操作</div></td>
		          </tr>
		          <!-- 列表循环开始 -->
				  <foreach name="list" item="obj">
				  <tr class="line" bgcolor="#FFFFFF">
		            <td class="list_td_height"><div align="center">{$obj.field_name}</div></td>
		            <td><div align="center">{$obj.field_desc}</div></td>
		            <td><div align="center">{$obj.form_type}<if condition="$obj.form_type eq FormType::$SELECT">[{$obj.select_type}]</if></div></td>
		            <td><div align="center"><if condition="$obj.is_system eq 1"><strong style="color:red;">是</strong><else/>否</if></div></td>
					<td><div align="center"><span class="span_block span_block{$obj.reserve_module_field_id}"><span class="span_{$obj.reserve_module_field_id}">{$obj.order_num}</span><a href="javascript:showChangeOrderNum({$obj.reserve_module_field_id});" target="_self">修改</a></span>&nbsp;<span class="action_block action_block{$obj.reserve_module_field_id}" style="display:none;"><input type="text" class="order_{$obj.reserve_module_field_id} order" id="order_{$obj.reserve_module_field_id}" value="{$obj.order_num}" style="width:80px;"/>&nbsp;<input type="button" name="savebtn" value="保存" onclick="saveOrderNum({$obj.reserve_module_field_id})"/></span></div></td>
		            <td><div align="center"><if condition="$obj.is_system eq 1"><span style="color:gray;">系统字段不能操作</span><else/><a href="__APP__/center/ReserveModuleField/todo/?id={$obj.reserve_module_field_id}&reserve_module_id={$reserve_module_id}">编辑&nbsp;|&nbsp;</a><a href="javascript:toConfirm('是否确定删除该数据？','__APP__/admin/ReserveModuleField/delete/?id={$obj.reserve_module_field_id}','__APP__');" target="_self">删除</a></if></div></td>
		          </tr>
		          </foreach>
				  <!-- 列表循环结束 -->
		         </table>
			     <div style="margin-top: 10px;">{$pagination.htmlurl}</div>
			</div>
	      </td>
	    </tr>
	  </tbody>
	</table>
</body>
</html>
